var _member = null;
function setPrintData(member) {
  _member = member;
  _prt.setPageSize(85, 54);
  _prt.setPreviewScale(1.5);
  setPrint1();

  var div = getEl("div_ops");
  if(div) div.innerHTML = '<label><input type="radio" class="radio" name="ops" onclick="setPrint1();_prt.preview();" checked>IC卡</label>'
                        + '<label><input type="radio" class="radio" name="ops" onclick="setPrint2();_prt.preview();">磁条卡</label>';
}

function setPrint1() {
  _prt.clear();
  _prt.setPreviewBgImg("/images/card1.jpg");

  _prt.add(["dt", _member.memberName, 20, 5.5]);
  _prt.add(["dt", _member.genderName, 52, 5.5]);
  _prt.add(["dt", _member.idNumber, 8.5, 20]);

  _prt.add(["di", _member.memberPhoto, 50, 12, 25, 25]);
}

function setPrint2() {
  _prt.clear();
  _prt.setPreviewBgImg("/images/card2.jpg");

  _prt.add(["dt", _member.memberName, 20, 18]);
  _prt.add(["dt", _member.genderName, 52, 18]);
  _prt.add(["dt", _member.idNumber, 7, 30]);

  _prt.add(["di", _member.memberPhoto, 53, 22, 25, 25]);
}

function printOk() {
  if(_member) getJson("_make?cardCode="+_member.cardCode);
}